<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="">
    书名：<input type="text" name="bookname"><br>
    作者：<input type="text" name="author"><br />
    出版社：<input type="text" name="publisher"><br />
    性别：<input type="radio" name="sex" value="nan">男
    <input type="radio" name="sex" value="nv">女<br>
    下拉框：<select name="address">
      <option value="beijing">北京</option>
      <option value="shanghai">上海</option>
      <option value="guangzhou">广州</option>
    </select>
  </form>
    <script src="./form-value.js"></script>
    <script>
      // 准备回填的数据
        let shuju = {
          // 要求对象跟键和表单项的name一致
            bookname:'三国演义',
            author:'阿顺',
            publisher:'安徽出版社',
            sex:'nan',
            address:'beijing'
        }
        // 数据回填
        // val(表单，数据)
        val(document.querySelector('form'),shuju)
    </script>
</body>
</html>